package com.legoo.studaychineseonline.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.legoo.studaychineseonline.R;
import com.legoo.studaychineseonline.adapter.MessageAdapter;
import com.legoo.studaychineseonline.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
 * 系统消息
 * */
public class MessageActivity extends BaseActivity {
    @BindView(R.id.tv_title_left)
    TextView tvTitleLeft;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_title_right)
    TextView tvTitleRight;
    @BindView(R.id.rv_message)
    RecyclerView rvMessage;
    List<String> list = new ArrayList<>();

    @Override
    protected void myOnCreate(@Nullable Bundle savedInstanceState) {
        ButterKnife.bind(this);
        tvTitle.setText("系统消息");
        tvTitleRight.setVisibility(View.INVISIBLE);
        tvTitleLeft.setBackgroundResource(R.mipmap.img_fanhui);
    }

    @Override
    protected void initData() {
        list.add("0");
        list.add("0");
        list.add("0");
        list.add("0");
        rvMessage.setLayoutManager(new LinearLayoutManager(context,LinearLayoutManager.VERTICAL,false));
        rvMessage.setAdapter( new MessageAdapter(R.layout.item_message,list));
    }

    @Override
    protected void resolveBundle(Bundle bundle) {

    }

    @Override
    protected int myLayoutId() {
        return R.layout.activity_message;
    }


    @OnClick({R.id.tv_title_left})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_title_left:
                finish();
                break;
                default:
                    break;

        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }
}
